// pages/reuse/reuse.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    type: ["塑料瓶", "厨余垃圾", "蚊香灰", "旧衣服"],
    activeIndex: 0, //当前选中分类
    videoIsPlay: false, //视屏是否播放
    reuseList: [{
        video: {
          videoUrl: "https://ksv-video-publish.cdn.bcebos.com/f38739e0efc5a60eec9a4b4b5c11cb99b6be015e.mp4?auth_key=1622702631-0-0-e688f8fd5e18c35d72f96d75bde66dca",
          videoImg: "../../images/type_1_0.png"
        },
        steps: [{
            title: "一、准备工作",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/kk66rB1Xibt5vb.qbHsPu1Pc6KkvwrrOr6XxIEQOKio!/b/dAQBAAAAAAAA&bo=4ATCAQAAAAADBwU!&rf=viewer_4'
          },
          {
            title: "二、裁剪工作",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/ldutSl4Z0b86M.m47JgYEavvbayogYI8q93T3xDhK.k!/b/dLgAAAAAAAAA&bo=4QS3AQAAAAADJ1E!&rf=viewer_4&t=5'
          },
          {
            title: "三、编织工作",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/ldutSl4Z0b86M.m47JgYEavvbayogYI8q93T3xDhK.k!/b/dLgAAAAAAAAA&bo=4QS3AQAAAAADJ1E!&rf=viewer_4&t=5'
          },
          {
            title: "四、收尾工作",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/bxYTYhHzVnTXIKTtxVELibJuUjbzrc7TLREJbwAhCEE!/b/dL8AAAAAAAAA&bo=4wSzAQAAAAADJ1c!&rf=viewer_4'
          },
          {
            title: "五、温馨提示",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/OdWSOkK7YQfrBYUd4dw*y1aiHucUE45vFRMB3uoKdH8!/b/dL4AAAAAAAAA&bo=4gS7AQAAAAADJ14!&rf=viewer_4'
          }
        ],
      },
      {
        video: {
          videoUrl: "https://ksv-video-publish.cdn.bcebos.com/e4882f8b96fcf2c973b1c858fc05686167f6f801.mp4?auth_key=1622715029-0-0-2358ab0329be1701947619ee20c0ef96",
          videoImg: "../../images/type_2_0.png"
        },
        steps: [{
            title: "一、准备工作",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/.jjsJ5A.W346epL*MIhRUa0rsQhyEXf6OT*o0LvffQE!/b/dLYAAAAAAAAA&bo=4AQXAgAAAAADN.M!&rf=viewer_4'
          },
          {
            title: "二、放土",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/70weCFU3TszTzokQmjlanmwHnkM7i4HzITGq.2dnMOk!/b/dFQBAAAAAAAA&bo=5AQdAgAAAAADN.0!&rf=viewer_4'
          },
          {
            title: "三、铺厨余垃圾铲平",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/63iXwdZeVXLU.JbX2TnFdf9Pamx.HZB3E9xNB7sAKlY!/b/dLgAAAAAAAAA&bo=4AQeAgAAAAADN.o!&rf=viewer_4'
          },
          {
            title: "四、放土",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/kd8NPHSj8V4wadncMwV52FJL3t1d2N*ZUdKjLqvlBFM!/b/dL8AAAAAAAAA&bo=4AQSAgAAAAADN.Y!&rf=viewer_4'
          },
          {
            title: "五、铺厨余垃圾铲平",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/QJsh9DaObTRSHzT9SXSX5QjcNOaZpqBMv91qD.X9nnE!/b/dLYAAAAAAAAA&bo=5AQbAgAAAAADR5s!&rf=viewer_4'
          },
          {
            title: "六、放土",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/Ca43*LJrogpXCIqBRoKeOhGo*bCp23Nh7eE2RVaORws!/b/dFQBAAAAAAAA&bo=4QQYAgAAAAADN.0!&rf=viewer_4'
          },
          {
            title: "七、铺厨余垃圾铲平",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/vQZaXdk2DajKFnK*plUrqRCE0UbQYcdHZs2rW7g3HNU!/b/dMMAAAAAAAAA&bo=5QQWAgAAAAADR5c!&rf=viewer_4'
          },
          {
            title: "八、放土",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/t2*dQ15NT4oU3PtpR3v9XUPRTuxYEcnci.r27BIeFm0!/b/dFIBAAAAAAAA&bo=3gQaAgAAAAADN9A!&rf=viewer_4'
          },
          {
            title: "九、加水",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/7NHWkjpJrdB9Na8CkLq8JH4uPUxiUNgY2P8EhQ5rfJw!/b/dLYAAAAAAAAA&bo=4gQaAgAAAAADN.w!&rf=viewer_4'
          },
          {
            title: "十、密封发酵",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/z6QYFaCUraFswgQFYEKUeogeaU1NunU0uI*4J98bN0E!/b/dMMAAAAAAAAA&bo=4QQaAgAAAAADN.8!&rf=viewer_4'
          },
          {
            title: "十一、种菜",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/za9ihiqj9rb*iA*ta*1OE4h0dsrordUYPFDSNwHXpWo!/b/dLgAAAAAAAAA&bo=4wQbAgAAAAADR5w!&rf=viewer_4'
          }
        ],
      },
      {
        video: {
          videoUrl: "https://ksv-video-publish.cdn.bcebos.com/4756481248ee86b85b2fff8d00cb57e6c46be9de.mp4?auth_key=1622721328-0-0-62280459849144764baf0d2069fc8907",
          videoImg: "../../images/type_3_0.png"
        },
        steps: [{
            title: "一、磨刀具",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/0b37aUZOxC5ION9Mae8SA5W.CBzrGkJM6yEmXyuf0zg!/b/dL8AAAAAAAAA&bo=4gSgAQAAAAADJ0U!&rf=viewer_4'
          },
          {
            title: "二、止痒",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/QEsWZ4Pe8tS7aYQaVexrjCZ6o8T*PywNhzbiqgK7sY8!/b/dL8AAAAAAAAA&bo=4QSeAQAAAAADJ3g!&rf=viewer_4'
          },
          {
            title: "三、肥料",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/OiFXXzozyJodeOE5vVWLFVxNGNrQzpngsqnEjURRYyA!/b/dMUAAAAAAAAA&bo=5QSyAQAAAAADJ1A!&rf=viewer_4'
          }
        ],
      },
      {
        video: {
          videoUrl: "https://ksv-video-publish.cdn.bcebos.com/22fd4f2140c4d759d445c480e47ff42c113fa64c.mp4?auth_key=1622700560-0-0-78773b08562d58c0c926d7afbb26c4dd",
          videoImg: "../../images/type_4_0.png"
        },
        steps: [{
            title: "一、置物筐",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/MQdo05hRlgORVLOumcnFNKPp6RWM*OQY0mbL0*wSwVs!/b/dL8AAAAAAAAA&bo=4QQUAgAAAAADN.E!&rf=viewer_4'
          },
          {
            title: "二、购物袋",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/zmomXuCbassb1VtKsy3UF8LdxUCXW5VwoXD.2OEnjtU!/b/dFIBAAAAAAAA&bo=3wQXAgAAAAADN9w!&rf=viewer_4'
          },
          {
            title: "三、包装袋",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/57SaXrTyjwanwSRjvi7iVezJzOHUGQA0fHPNoboB14Q!/b/dFQBAAAAAAAA&bo=5gQZAgAAAAADR5s!&rf=viewer_4'
          },
          {
            title: "四、收纳袋",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/RUp*nOf*pZ1k17n00WA7*gkZ*c62DuHfbDlMhl2nlu8!/b/dDcBAAAAAAAA&bo=5wQXAgAAAAADN.Q!&rf=viewer_4'
          },
          {
            title: "五、拼接被套",
            img: 'http://m.qpic.cn/psb?/V12B7iTX0RLKiy/W4K5BodQNOoX2fFc9mwdUEQiG*nmqDz3.HDWq3XiRP4!/b/dFMBAAAAAAAA&bo=4QQWAgAAAAADR5M!&rf=viewer_4'
          }
        ],
      }
    ],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },

  /**
   * @author: 魏申兰 [1506934670@qq.com]
   * @Date: 2019-12-11 10:04:02
   * @description: 点击类别
   * @param {object} e 事件对象
   * @update: 
   */
  handleCLick(e) {
    let index = e.currentTarget.dataset.index;
    this.setData({
      activeIndex: index,
      videoIsPlay: false
    })
  },
  /**
   * @author: 魏申兰 [1506934670@qq.com]
   * @Date: 2019-12-11 10:04:02
   * @description: 视屏播放
   * @param {type} 
   * @update: 
   */
  playVideo() {
    this.setData({
      videoIsPlay: true
    })
  },
  /**
   * @author: 魏申兰 [1506934670@qq.com]
   * @Date: 2019-12-11 10:04:02
   * @description: 视屏播放完成
   * @param {type} 
   * @update: 
   */
  playOver() {
    this.setData({
      videoIsPlay: false
    })
  },
  /**
   * @author: 魏申兰 [1506934670@qq.com]
   * @Date: 2019-12-11 10:04:02
   * @description: 图片预览
   * @param {type} 
   * @update: 
   */
  preview(e) {
    let imgs = [];
    let index = e.currentTarget.dataset.index;
    let current = e.currentTarget.dataset.url;
    for (let i = 0; i < this.data.reuseList[index].steps.length; i++) {
      imgs.push(this.data.reuseList[index].steps[i].img)
    }
    wx.previewImage({
      current: current, // 当前显示图片的http链接
      urls: imgs, // 需要预览的图片http链接列表
    })
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})